Crate mongocrypt_sys
source ·Expand description
FFI bindings to libmongocrypt.
These bindings are generated by rust-bindgen.
Structs§
- A non-owning view of a byte buffer.
Constants§
Functions§
- Get a pointer to the viewed data.
- Free the @ref mongocrypt_binary_t.
- Get the length of the viewed data.
- Create a new non-owning view of a buffer (data + length).
- Create a new non-owning view of a buffer (data + length).
- @brief Obtain a 64-bit constant encoding the version of the loaded crypt_shared library, if available.
- Obtain a nul-terminated version string of the loaded crypt_shared dynamic library, if available.
- Initialize a context to create a data key.
- Initialize a context for decryption.
- Destroy and free all memory associated with a @ref mongocrypt_ctx_t.
- Initialize a context for encryption.
- Explicit helper method to decrypt a single BSON object.
- Explicit helper method to encrypt a Match Expression or Aggregate Expression. Contexts created for explicit encryption will not go through mongocryptd. Requires query_type to be “range”.
- Explicit helper method to encrypt a single BSON object. Contexts created for explicit encryption will not go through mongocryptd.
- Perform the final encryption or decryption.
- Call when done handling all KMS contexts.
- Get the database to run the mongo operation.
- Call when done feeding the reply (or replies) back to the context.
- Feed a BSON reply or result when mongocrypt_ctx_t is in MONGOCRYPT_CTX_NEED_MONGO_* states. This may be called multiple times depending on the operation.
- Get BSON necessary to run the mongo operation when mongocrypt_ctx_t is in MONGOCRYPT_CTX_NEED_MONGO_* states.
- Create a new uninitialized @ref mongocrypt_ctx_t.
- Get the next KMS handle.
- Call in response to the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state to set per-context KMS provider settings. These follow the same format as @ref mongocrypt_setopt_kms_providers. If no keys are present in the BSON input, the KMS provider settings configured for the @ref mongocrypt_t at initialization are used.
- @brief Initialize a context to rewrap datakeys.
- Set the algorithm used for encryption to either deterministic or random encryption. This value should only be set when using explicit encryption.
- Set options for explicit encryption with the “range” algorithm.
- Set the contention factor used for explicit encryption. The contention factor is only used for indexed Queryable Encryption.
- Set the index key id to use for explicit Queryable Encryption.
- Set the keyAltName to use for explicit encryption or data key creation.
- Set key encryption key document for creating a data key or for rewrapping datakeys.
- Set the key id to use for explicit encryption.
- Set the keyMaterial to use for encrypting data.
- Identify the AWS KMS master key to use for creating a data key.
- Identify a custom AWS endpoint when creating a data key. This is used internally to construct the correct HTTP request (with the Host header set to this endpoint). This endpoint is persisted in the new data key, and will be returned via @ref mongocrypt_kms_ctx_endpoint.
- Set the master key to “local” for creating a data key. This has been superseded by the more flexible: @ref mongocrypt_ctx_setopt_key_encryption_key
- Set the query type to use for explicit Queryable Encryption.
- Get the current state of a context.
- Get the status associated with a @ref mongocrypt_ctx_t object.
- Destroy the @ref mongocrypt_t object.
- Initialize new @ref mongocrypt_t object.
- Returns true if libmongocrypt was built with native crypto support.
- Indicates how many bytes to feed into @ref mongocrypt_kms_ctx_feed.
- Get the hostname from which to connect over TLS.
- Feed bytes from the HTTP response.
- Get the KMS provider identifier associated with this KMS request.
- Get the HTTP request message for a KMS handle.
- Get the status associated with a @ref mongocrypt_kms_ctx_t object.
- Allocate a new @ref mongocrypt_t object.
- Set a crypto hook for the AES256-CTR operations.
- Set an AES256-ECB crypto hook for the AES256-CTR operations. If CTR hook was configured using @ref mongocrypt_setopt_aes_256_ctr, ECB hook will be ignored.
- @brief Append an additional search directory to the search path for loading the crypt_shared dynamic library.
- @brief Opt-into skipping query analysis.
- Set a crypto hook for the RSASSA-PKCS1-v1_5 algorithm with a SHA-256 hash.
- Set a local EncryptedFieldConfigMap for encryption.
- Configure an AWS KMS provider on the @ref mongocrypt_t object.
- Configure a local KMS provider on the @ref mongocrypt_t object.
- Configure KMS providers with a BSON document.
- Set a handler on the @ref mongocrypt_t object to get called on every log message.
- Set a local schema map for encryption.
- @brief Set a single override path for loading the crypt_shared dynamic library.
- @brief Opt-into handling the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state.
- @brief Opt-into handling the MONGOCRYPT_CTX_NEED_MONGO_COLLINFO_WITH_DB state.
- DEPRECATED: Use of
mongocrypt_setopt_use_range_v2
is deprecated. Range V2 is always enabled. - Get the status associated with a @ref mongocrypt_t object.
- Get an error code or 0.
- Free the memory for a status object.
- Get the error message associated with a status or NULL.
- Create a new status object.
- Returns true if the status indicates success.
- Set a status object with message, type, and code.
- Indicates success or the type of error.
- Returns the version string for libmongocrypt.
Type Aliases§
- A non-owning view of a byte buffer.
- An crypto AES-256-CBC encrypt or decrypt function.
- Indicates the state of the @ref mongocrypt_ctx_t. Each state requires different handling. See the integration guide for information on what to do for each state.
- Manages the state machine for encryption or decryption.
- A crypto hash (SHA-256) function.
- A crypto signature or HMAC function.
- Manages a single KMS HTTP request/response.
- A log callback function. Set a custom log callback with @ref mongocrypt_setopt_log_handler.
- Indicates the type of log message.
- A crypto secure random function.
- Indicates success or contains error information.
- Indicates the type of error.
- The top-level handle to libmongocrypt.